package br.com.caelum.vraptor.controller;

import java.util.List;

import javax.inject.Inject;

import br.com.caelum.vraptor.Controller;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.dao.CardapioDAO;
import br.com.caelum.vraptor.dao.GenericDAO;
import br.com.caelum.vraptor.entidades.Cardapio;

@Controller
public class CardapioController {
	
	@Inject
	private Result result;
	               
	@Inject
	private GenericDAO<Cardapio> dao;
	
	public void add(){
		
	}
	
	public List<Cardapio> list(){
		return dao.find();
	}
	
	public void save(Cardapio cardapio){
		dao.save(cardapio);
		result.redirectTo(this).list();
	}
	
}
